package PhaseoneModulethree.TheFirstQuesion.code;
/*
* 编程统计字符串"ABCD123!@#$%ab"中大写字母、小写字母、数字、其它字符的个数并打 印出来。
* */

public class TheFirstQuestion {
    public static void main(String[] args) {

        String s1 = "ABCD123!@#$%ab";
        char[] c1 = s1.toCharArray();
        int upCount = 0;
        int lowCount = 0;
        int numCount = 0;
        int otherCount = 0;

        for (int i = 0; i < c1.length; i++) {
            if (c1[i]>=65 && c1[i]<=90){
                upCount++;
            }else if (c1[i]>=97 && c1[i]<=122){
                lowCount++;
            }else if (c1[i]>=48 && c1[i]<=57){
                numCount++;
            }else{
                otherCount++;
            }
        }
        System.out.println("大写字母的个数是："+upCount);
        System.out.println("小写字母的个数是："+lowCount);
        System.out.println("数字的个数是："+numCount);
        System.out.println("其他字符的个数是："+otherCount);
    }
}
